/********************************************************************
filename : wolf_usart.h
discript : usart1 driver for default information output.
version  : V0.0
editor   : Icy - dreamwolf
time     : 2014.2.25
statement: This file is modified by dreamwolf under LGPL,you could use 
           it free.We cann't ensure there is no error in this file,and
				   if you detect an error please contact us freely,it is so a-
					 ppreciate for your help to improve our code that could help 
					 more people to use it safty.
contact  : dreamwolf66@163.com
           www.zyltek.com
********************************************************************/

#ifndef __WOLF_USART_H__
#define __WOLF_USART_H__

#include <stdio.h>
#include "stm32f0xx.h"
#include "wolf_typedefine.h"



#define WOLF_COM1                        USART1
#define WOLF_COM1_CLK                    RCC_APB2Periph_USART1
#define WOLF_COM1_TX_PIN                 GPIO_Pin_9
#define WOLF_COM1_TX_GPIO_PORT           GPIOA
#define WOLF_COM1_TX_GPIO_CLK            RCC_AHBPeriph_GPIOA
#define WOLF_COM1_TX_SOURCE              GPIO_PinSource9
#define WOLF_COM1_TX_AF                  GPIO_AF_1
#define WOLF_COM1_RX_PIN                 GPIO_Pin_10
#define WOLF_COM1_RX_GPIO_PORT           GPIOA
#define WOLF_COM1_RX_GPIO_CLK            RCC_AHBPeriph_GPIOA
#define WOLF_COM1_RX_SOURCE              GPIO_PinSource10
#define WOLF_COM1_RX_AF                  GPIO_AF_1
#define WOLF_COM1_IRQn                   USART1_IRQn

#define USARTx_IRQHANDLER   						 USART1_IRQHandler

#define RXBUFFERSIZE   										0x20


/* Public variables -----------------------------------------------*/
extern uint8_t Rx_flag;
extern uint8_t RxBuffer[RXBUFFERSIZE];
extern uint8_t NbrOfDataToRead;
extern __IO uint16_t RxCounter; 



/* Public function ------------------------------------------------*/
void board_usart_init(USART_InitTypeDef* USART_InitStruct);

void wolf_usart_RX_enable(void);



/* Private function -----------------------------------------------*/
void wolf_usart_NVIC_Config(void);







#endif

